```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JDBC批量处理技术指南</title>
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            line-height: 1.8;
            color: #333;
            background-color: #f9fafb;
        }
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 700;
            color: #1a202c;
        }
        .code-block {
            background-color: #2d3748;
            color: #f7fafc;
            border-radius: 0.5rem;
            padding: 1.25rem;
            margin: 1rem 0;
            overflow-x: auto;
        }
        .code-block pre {
            margin: 0;
            font-family: 'Courier New', Courier, monospace;
            font-size: 0.875rem;
            line-height: 1.5;
        }
        .card {
            background-color: white;
            border-radius: 0.5rem;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
        }
        .card:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
        }
        .highlight {
            background-color: #fff9c2;
            padding: 0.2rem 0.4rem;
            border-radius: 0.25rem;
        }
        .feature-icon {
            color: #4f46e5;
            font-size: 1.5rem;
            margin-right: 0.75rem;
        }
        .divider {
            height: 1px;
            background-color: #e2e8f0;
            margin: 2rem 0;
        }
        .hero-image {
            width: 100%;
            height: 400px;
            object-fit: cover;
            border-radius: 0.5rem;
            margin-bottom: 2rem;
        }
    </style>
</head>
<body class="max-w-6xl mx-auto px-4 py-8">
    <!-- Hero Section -->
    <div class="text-center mb-12">
        <h1 class="text-4xl md:text-5xl font-bold mb-4 text-indigo-800">JDBC批量处理技术指南</h1>
        <p class="text-xl text-gray-600 mb-6">高效处理大规模数据，提升数据库操作性能</p>
        <div class="flex justify-center">
            <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1735973367762-1d0e52b2-eba0-4c59-84fa-0b658fa56410.png" alt="JDBC批量处理" class="hero-image shadow-lg">
        </div>
        <p class="text-lg text-gray-700 max-w-3xl mx-auto">
            数据库操作往往是应用程序性能瓶颈的关键因素之一。通过JDBC批量处理技术，我们可以显著提高数据处理效率，减少数据库交互次数，优化系统性能。
        </p>
    </div>

    <!-- Introduction Section -->
    <div class="card">
        <h2 class="text-2xl font-bold mb-4 flex items-center">
            <i class="fas fa-database feature-icon"></i> 批量处理的基本概念
        </h2>
        <p class="mb-4">
            批量处理是指将多个数据库操作（如插入、更新、删除等）打包在一个请求中一次性提交到数据库，而不是逐条执行。这种方式显著减少了与数据库的交互次数，从而提高了性能，降低了数据库负载和网络延迟。
        </p>
        <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1735973415282-fd260c7f-5b71-47c8-955b-61080ce7e5c0.png" alt="批量处理概念图" class="rounded-lg mb-4">
        
        <div class="grid md:grid-cols-2 gap-6 mt-6">
            <div>
                <h3 class="text-xl font-semibold mb-3 text-indigo-700 flex items-center">
                    <i class="fas fa-check-circle mr-2"></i> 批量处理的优势
                </h3>
                <ul class="space-y-2">
                    <li class="flex items-start">
                        <i class="fas fa-arrow-up text-green-500 mt-1 mr-2"></i>
                        <span><span class="font-medium">提高性能：</span>通过减少与数据库的交互次数，批量操作能够显著提升数据处理速度。</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fas fa-network-wired text-blue-500 mt-1 mr-2"></i>
                        <span><span class="font-medium">减少网络延迟：</span>批量提交减少了传输次数，降低了网络延迟。</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fas fa-server text-purple-500 mt-1 mr-2"></i>
                        <span><span class="font-medium">减少数据库负载：</span>数据库会对批量请求进行优化，减少资源消耗。</span>
                    </li>
                </ul>
            </div>
            <div>
                <h3 class="text-xl font-semibold mb-3 text-indigo-700 flex items-center">
                    <i class="fas fa-tasks mr-2"></i> 批量处理的应用场景
                </h3>
                <ul class="space-y-2">
                    <li class="flex items-start">
                        <i class="fas fa-plus-circle text-green-500 mt-1 mr-2"></i>
                        <span><span class="font-medium">批量插入：</span>大量数据一次性插入数据库</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fas fa-sync-alt text-blue-500 mt-1 mr-2"></i>
                        <span><span class="font-medium">批量更新：</span>对多条记录执行相同修改</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fas fa-trash-alt text-red-500 mt-1 mr-2"></i>
                        <span><span class="font-medium">批量删除：</span>删除大量符合条件的记录</span>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <!-- Application Scenarios -->
    <div class="card">
        <h2 class="text-2xl font-bold mb-4 flex items-center">
            <i class="fas fa-project-diagram feature-icon"></i> JDBC批量处理的应用场景
        </h2>
        <p class="mb-4">
            JDBC批量处理技术能够显著提高数据库操作的效率，尤其在处理大量数据时，其优势尤为明显。以下是几种常见的批量处理应用场景：
        </p>
        <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1735974687163-8df37575-855a-40f5-8389-b39f40823956.png" alt="应用场景图" class="rounded-lg mb-6">

        <div class="grid md:grid-cols-2 gap-6">
            <div class="bg-indigo-50 p-4 rounded-lg">
                <h3 class="text-xl font-semibold mb-2 text-indigo-700 flex items-center">
                    <i class="fas fa-sign-in-alt mr-2"></i> 批量插入(INSERT)
                </h3>
                <p><span class="font-medium">场景描述：</span>当需要将大量记录插入数据库时，例如导入日志数据、批量导入用户信息。</p>
                <p class="mt-2"><span class="font-medium">优势：</span>减少网络交互次数，提高性能。</p>
                <p class="mt-2"><span class="font-medium">举例：</span>电商平台每天导入成千上万条用户注册数据。</p>
            </div>
            <div class="bg-blue-50 p-4 rounded-lg">
                <h3 class="text-xl font-semibold mb-2 text-blue-700 flex items-center">
                    <i class="fas fa-sync mr-2"></i> 批量更新(UPDATE)
                </h3>
                <p><span class="font-medium">场景描述：</span>当需要对多条记录执行相同的更新操作时。</p>
                <p class="mt-2"><span class="font-medium">优势：</span>显著降低每次SQL执行的开销。</p>
                <p class="mt-2"><span class="font-medium">举例：</span>批量更新用户状态信息或活动记录。</p>
            </div>
            <div class="bg-red-50 p-4 rounded-lg">
                <h3 class="text-xl font-semibold mb-2 text-red-700 flex items-center">
                    <i class="fas fa-trash mr-2"></i> 批量删除(DELETE)
                </h3>
                <p><span class="font-medium">场景描述：</span>在清理数据库中的过时数据、删除符合条件的记录时。</p>
                <p class="mt-2"><span class="font-medium">优势：</span>减少操作次数，避免过多锁竞争。</p>
                <p class="mt-2"><span class="font-medium">举例：</span>清理过期订单、删除不活跃用户数据。</p>
            </div>
            <div class="bg-green-50 p-4 rounded-lg">
                <h3 class="text-xl font-semibold mb-2 text-green-700 flex items-center">
                    <i class="fas fa-archive mr-2"></i> 数据迁移与同步
                </h3>
                <p><span class="font-medium">场景描述：</span>当需要从一个数据库迁移数据到另一个数据库时。</p>
                <p class="mt-2"><span class="font-medium">优势：</span>减少操作延迟，快速迁移大量数据。</p>
                <p class="mt-2"><span class="font-medium">举例：</span>将历史数据从老数据库迁移到新系统。</p>
            </div>
        </div>
    </div>

    <!-- Basic Methods -->
    <div class="card">
        <h2 class="text-2xl font-bold mb-4 flex items-center">
            <i class="fas fa-code feature-icon"></i> JDBC批量处理的基本方法
        </h2>
        <p class="mb-4">
            在JDBC中，批量处理通常通过<code class="highlight">Statement</code>或<code class="highlight">PreparedStatement</code>对象来执行，以下是常见的批量处理方法。
        </p>

        <div class="mt-6">
            <h3 class="text-xl font-semibold mb-3 text-indigo-700 flex items-center">
                <i class="fas fa-terminal mr-2"></i> 使用Statement执行批量处理
            </h3>
            <p class="mb-3">使用<code class="highlight">Statement</code>对象进行批量处理的基本步骤：</p>
            <div class="code-block">
                <pre>String insertSQL1 = "INSERT INTO employees (id, name, age) VALUES (1, 'Alice', 30)";
String insertSQL2 = "INSERT INTO employees (id, name, age) VALUES (2, 'Bob', 25)";

Statement stmt = connection.createStatement();
stmt.addBatch(insertSQL1);  // 添加SQL语句到批量队列
stmt.addBatch(insertSQL2);  // 添加SQL语句到批量队列

int[] results = stmt.executeBatch();  // 执行批量操作</pre>
            </div>
            <p class="mt-3 text-sm text-gray-600"><strong>注意事项：</strong> <code class="highlight">Statement</code>不适用于带有参数化查询的场景。批量的SQL语句必须相似，否则使用<code class="highlight">PreparedStatement</code>更合适。</p>
        </div>

        <div class="mt-8">
            <h3 class="text-xl font-semibold mb-3 text-indigo-700 flex items-center">
                <i class="fas fa-terminal mr-2"></i> 使用PreparedStatement执行批量处理
            </h3>
            <p class="mb-3"><code class="highlight">PreparedStatement</code>比<code class="highlight">Statement</code>更适合批量处理，尤其是当SQL语句中包含参数时：</p>
            <div class="code-block">
                <pre>String insertSQL = "INSERT INTO employees (id, name, age) VALUES (?, ?, ?)";

PreparedStatement pstmt = connection.prepareStatement(insertSQL);

// 第一条数据
pstmt.setInt(1, 1);
pstmt.setString(2, "Alice");
pstmt.setInt(3, 30);
pstmt.addBatch();  // 添加到批量队列

// 第二条数据
pstmt.setInt(1, 2);
pstmt.setString(2, "Bob");
pstmt.setInt(3, 25);
pstmt.addBatch();  // 添加到批量队列

// 执行批量操作
int[] results = pstmt.executeBatch();</pre>
            </div>
            <p class="mt-3 text-sm text-gray-600"><strong>优势：</strong> <code class="highlight">PreparedStatement</code>在处理参数化SQL时性能更优，适用于动态值较多的批量操作，能显著提高执行效率。</p>
        </div>

        <div class="mt-8">
            <h3 class="text-xl font-semibold mb-3 text-indigo-700 flex items-center">
                <i class="fas fa-expand mr-2"></i> 使用executeLargeBatch()执行大批量操作
            </h3>
            <p class="mb-3">对于非常大的批量操作（比如上百万条数据），可以使用<code class="highlight">executeLargeBatch()</code>方法：</p>
            <div class="code-block">
                <pre>PreparedStatement pstmt = connection.prepareStatement(insertSQL);

// 添加大批量数据...

long[] results = pstmt.executeLargeBatch();  // 执行大批量操作</pre>
            </div>
        </div>

        <div class="mt-8">
            <h3 class="text-xl font-semibold mb-3 text-indigo-700 flex items-center">
                <i class="fas fa-exchange-alt mr-2"></i> 批量操作的事务管理
            </h3>
            <p class="mb-3">批量处理通常需要与事务结合使用，以确保批量操作的一致性和原子性：</p>
            <div class="code-block">
                <pre>connection.setAutoCommit(false);  // 禁用自动提交，开启事务

try {
    for (int i = 0; i < data.length; i++) {
        pstmt.setInt(1, data[i].getId());
        pstmt.setString(2, data[i].getName());
        pstmt.addBatch();
    }
    pstmt.executeBatch();  // 执行批量操作
    connection.commit();   // 提交事务
} catch (SQLException e) {
    connection.rollback();  // 回滚事务
} finally {
    connection.setAutoCommit(true);  // 恢复自动提交
}</pre>
            </div>
        </div>
    </div>

    <!-- Optimization Techniques -->
    <div class="card">
        <h2 class="text-2xl font-bold mb-4 flex items-center">
            <i class="fas fa-tachometer-alt feature-icon"></i> JDBC批量处理的优化
        </h2>
        <p class="mb-4">
            JDBC批量处理在大规模数据操作时可以显著提升性能，但为了发挥其最大效能，需要对批量操作的细节进行优化。
        </p>

        <div class="grid md:grid-cols-2 gap-6 mt-6">
            <div class="bg-yellow-50 p-4 rounded-lg">
                <h3 class="text-xl font-semibold mb-2 text-yellow-700 flex items-center">
                    <i class="fas fa-ruler mr-2"></i> 合理设置批量大小
                </h3>
                <p><span class="font-medium">问题：</span>批量过大可能导致内存溢出，过小则无法充分利用批量处理的优势。</p>
                <p class="mt-2"><span class="font-medium">优化建议：</span>设置合适的批量大小（通常500-1000条）。</p>
                <div class="code-block mt-3">
                    <pre>int batchSize = 1000;  // 设置批量大小为1000
for (int i = 0; i < totalRecords; i++) {
    pstmt.setInt(1, data[i].getId());
    pstmt.setString(2, data[i].getName());
    pstmt.addBatch();
    
    if (i % batchSize == 0 || i == totalRecords - 1) {
        pstmt.executeBatch();  // 执行当前批次
    }
}</pre>
                </div>
            </div>

            <div class="bg-green-50 p-4 rounded-lg">
                <h3 class="text-xl font-semibold mb-2 text-green-700 flex items-center">
                    <i class="fas fa-plug mr-2"></i> 避免重复创建连接
                </h3>
                <p><span class="font-medium">问题：</span>每次批量操作都打开和关闭数据库连接，增加了额外开销。</p>
                <p class="mt-2"><span class="font-medium">优化建议：</span>复用数据库连接，批量操作期间保持连接开启。</p>
                <div class="code-block mt-3">
                    <pre>Connection connection = dataSource.getConnection();
try {
    connection.setAutoCommit(false);
    PreparedStatement pstmt = connection.prepareStatement(insertSQL);
    // 执行批量操作...
    connection.commit();
} catch (SQLException e) {
    connection.rollback();
} finally {
    connection.setAutoCommit(true);
    connection.close();
}</pre>
                </div>
            </div>

            <div class="bg-blue-50 p-4 rounded-lg">
                <h3 class="text-xl font-semibold mb-2 text-blue-700 flex items-center">
                    <i class="fas fa-database mr-2"></i> 减少数据库索引
                </h3>
                <p><span class="font-medium">问题：</span>过多的索引会导致每次批量操作时都需要更新索引，增加开销。</p>
                <p class="mt-2"><span class="font-medium">优化建议：</span>批量操作前暂时删除不必要的索引，操作完成后再恢复。</p>
                <div class="code-block mt-3">
                    <pre>-- 禁用索引
ALTER TABLE users DISABLE KEYS;

-- 执行批量插入...

-- 恢复索引
ALTER TABLE users ENABLE KEYS;</pre>
                </div>
            </div>

            <div class="bg-purple-50 p-4 rounded-lg">
                <h3 class="text-xl font-semibold mb-2 text-purple-700 flex items-center">
                    <i class="fas fa-cog mr-2"></i> 优化数据库参数
                </h3>
                <p><span class="font-medium">问题：</span>数据库配置不当可能会限制批量处理的性能。</p>
                <p class="mt-2"><span class="font-medium">优化建议：</span>调整数据库的配置参数，如增加缓冲池大小、最大连接数等。</p>
                <div class="mt-3">
                    <ul class="list-disc pl-5 space-y-1">
                        <li>增大<code class="highlight">innodb_buffer_pool_size</code></li>
                        <li>调整<code class="highlight">max_connections</code></li>
                        <li>优化<code class="highlight">batch_size</code>参数</li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <!-- Case Study -->
    <div class="card">
        <h2 class="text-2xl font-bold mb-4 flex items-center">
            <i class="fas fa-laptop-code feature-icon"></i> JDBC批量处理的案例演示
        </h2>
        <p class="mb-4">
            以下是一个使用<code class="highlight">PreparedStatement</code>进行批量插入的完整JDBC示例，展示了如何批量插入1000条用户数据。
        </p>

        <div class="mt-6">
            <h3 class="text-xl font-semibold mb-3 text-indigo-700 flex items-center">
                <i class="fas fa-table mr-2"></i> 创建数据库表
            </h3>
            <div class="code-block">
                <pre>CREATE TABLE users (
    id INT PRIMARY KEY,
    name VARCHAR(100),
    email VARCHAR(100)
);</pre>
            </div>
        </div>

        <div class="mt-8">
            <h3 class="text-xl font-semibold mb-3 text-indigo-700 flex items-center">
                <i class="fas fa-file-code mr-2"></i> Java批量插入实现
            </h3>
            <div class="code-block">
                <pre>import java.sql.*;

public class JdbcBatchInsertDemo {

    // 数据库连接配置
    private static final String URL = "jdbc:mysql://localhost:3306/testdb";
    private static final String USER = "root";
    private static final String PASSWORD = "password";

    public static void main(String[] args) {
        // 模拟要插入的1000条数据
        String[][] users = new String[1000][3];
        for (int i = 0; i < 1000; i++) {
            users[i][0] = String.valueOf(i + 1);   // id
            users[i][1] = "User" + (i + 1);        // name
            users[i][2] = "user" + (i + 1) + "@ts.com";  // email
        }

        Connection connection = null;
        PreparedStatement pstmt = null;

        try {
            // 1. 获取数据库连接
            connection = DriverManager.getConnection(URL, USER, PASSWORD);
            connection.setAutoCommit(false);  // 禁用自动提交，手动管理事务

            // 2. 创建PreparedStatement对象
            String sql = "INSERT INTO users (id, name, email) VALUES (?, ?, ?)";
            pstmt = connection.prepareStatement(sql);

            // 3. 添加批量操作
            for (int i = 0; i < users.length; i++) {
                pstmt.setInt(1, Integer.parseInt(users[i][0]));
                pstmt.setString(2, users[i][1]);
                pstmt.setString(3, users[i][2]);
                pstmt.addBatch();  // 将每条记录添加到批量处理队列

                // 每100条数据提交一次
                if (i % 100 == 0 || i == users.length - 1) {
                    pstmt.executeBatch();  // 执行当前批次的插入操作
                }
            }

            // 4. 提交事务
            connection.commit();

            System.out.println("批量插入完成！");

        } catch (SQLException e) {
            try {
                if (connection != null) {
                    connection.rollback();  // 出现异常时回滚事务
                    System.out.println("事务回滚！");
                }
            } catch (SQLException ex) {
                ex.printStackTrace();
            }
            e.printStackTrace();
        } finally {
            try {
                // 5. 关闭资源
                if (pstmt != null) pstmt.close();
                if (connection != null) connection.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
}</pre>
            </div>
        </div>

        <div class="mt-6">
            <h3 class="text-xl font-semibold mb-3 text-indigo-700">代码解析</h3>
            <ol class="list-decimal pl-5 space-y-2">
                <li><strong>数据库连接：</strong>通过<code class="highlight">DriverManager.getConnection()</code>获取数据库连接。</li>
                <li><strong>事务管理：</strong>禁用自动提交，手动管理事务，确保批量插入的原子性。</li>
                <li><strong>批量操作：</strong>使用<code class="highlight">PreparedStatement</code>的<code class="highlight">addBatch()</code>方法添加记录，每100条执行一次批量操作。</li>
                <li><strong>异常处理：</strong>异常时回滚事务，确保数据一致性。</li>
                <li><strong>资源释放：</strong>在<code class="highlight">finally</code>块中关闭资源，避免连接泄漏。</li>
            </ol>
        </div>
    </div>

    <!-- Advanced Techniques -->
    <div class="card">
        <h2 class="text-2xl font-bold mb-4 flex items-center">
            <i class="fas fa-rocket feature-icon"></i> JDBC批量处理的高级技巧
        </h2>
        <p class="mb-4">
            除了基本的批量处理操作外，还有一些高级技巧可以进一步提升JDBC批量处理的性能和稳定性。
        </p>

        <div class="mt-6">
            <h3 class="text-xl font-semibold mb-3 text-indigo-700 flex items-center">
                <i class="fas fa-sort-numeric-up mr-2"></i> 动态调整批量大小
            </h3>
            <p>根据数据库负载和响应时间，动态调整批量大小：</p>
            <div class="code-block mt-3">
                <pre>// 根据执行时间动态调整批量大小
long startTime = System.currentTimeMillis();
pstmt.executeBatch();
long duration = System.currentTimeMillis() - startTime;

if (duration > 1000) {  // 如果执行时间超过1秒
    batchSize = Math.max(100, batchSize / 2);  // 减少批量大小
} else if (duration < 200) {
    batchSize = Math.min(5000, batchSize * 2);  // 增加批量大小
}</pre>
            </div>
        </div>

        <div class="mt-8">
            <h3 class="text-xl font-semibold mb-3 text-indigo-700 flex items-center">
                <i class="fas fa-key mr-2"></i> 禁用外键约束
            </h3>
            <p>在批量插入操作前禁用外键约束，完成后重新启用：</p>
            <div class="code-block mt-3">
                <pre>-- 禁用外键约束
SET foreign_key_checks = 0;

-- 执行批量插入操作...

-- 启用外键约束
SET foreign_key_checks = 1;</pre>
            </div>
        </div>

        <div class="mt-8">
            <h3 class="text-xl font-semibold mb-3 text-indigo-700 flex items-center">
                <i class="fas fa-project-diagram mr-2"></i> 使用存储过程处理复杂批量操作
            </h3>
            <p>对于复杂的批量操作，可以使用存储过程将逻辑推送到数据库端执行：</p>
            <div class="code-block mt-3">
                <pre>CallableStatement cstmt = connection.prepareCall("{call batch_insert_procedure(?, ?, ?)}");
for (Employee employee : employees) {
    cstmt.setInt(1, employee.getId());
    cstmt.setString(2, employee.getName());
    cstmt.setDouble(3, employee.getSalary());
    cstmt.addBatch();
}
cstmt.executeBatch();  // 执行存储过程批量操作</pre>
            </div>
        </div>
    </div>

    <!-- Summary Diagram -->
    <div class="card">
        <h2 class="text-2xl font-bold mb-4 flex items-center">
            <i class="fas fa-sitemap feature-icon"></i> JDBC批量处理技术概览
        </h2>
        <div class="mermaid">
            graph TD
                A[JDBC批量处理] --> B[基本方法]
                A --> C[优化技巧]
                A --> D[应用场景]
                
                B --> B1[Statement批量处理]
                B --> B2[PreparedStatement批量处理]
                B --> B3[事务管理]
                
                C --> C1[合理设置批量大小]
                C --> C2[连接复用]
                C --> C3[索引优化]
                C --> C4[参数调优]
                
                D --> D1[批量插入]
                D --> D2[批量更新]
                D --> D3[批量删除]
                D --> D4[数据迁移]
        </div>
    </div>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8 mt-12 rounded-lg">
        <div class="container mx-auto px-4">
            <div class="text-center">
                <h3 class="text-xl font-semibold mb-2">技术小馆</h3>
                <p class="mb-4">专业的编程技术学习平台</p>
                <a href="http://www.yuque.com/jtostring" class="text-indigo-300 hover:text-white transition-colors duration-200">http://www.yuque.com/jtostring</a>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```